package Eyjafjalla.action;

import Eyjafjalla.helper.EyjafjallaHelper;
import Eyjafjalla.patch.CloudPatch;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;

public class MarkFireAfterDrawAction extends AbstractGameAction {
    public MarkFireAfterDrawAction(boolean isCloud) {
        this.isCloud = isCloud;
    }

    boolean isCloud;

    @Override
    public void update() {
        if (!isCloud) {
            if (DrawCardAction.drawnCards.size() > 0) {
                for (AbstractCard c : DrawCardAction.drawnCards) {
                    EyjafjallaHelper.markCardToFire(c,1);
                }
            }
        } else if (DrawCloudAction.drawnCards.size() > 0) {
            for (AbstractCard c : DrawCloudAction.drawnCards) {
                if(!CloudPatch.CloudField.isFire.get(c)){
                    EyjafjallaHelper.markCardToFire(c,1);
                }
            }
        }
        this.isDone = true;
    }
}

